import uuid
import os.path


def filename_transfer(filename):
    ext_name = filename.rsplit(".")[1]
    print(ext_name)
    new_filename = uuid.uuid4().hex + "." + ext_name
    save_path = os.path.join('static/uploads/bgps/', new_filename)
    print(save_path)
    bgp_dir = 'static/uploads/bgps'
    print(bgp_dir)
    return save_path, bgp_dir


if __name__ == '__main__':
    filename_transfer('baidu.png')
